<?php
/**
 * @todo RFC for views raising events. there should be a standard for it
 */
$contentWidth = 24;
$ev_left = new ExtEvent($this,FALSE,'blog');
Yii::app()->modulehook->raiseEvent('blog.views.layouts.main.show.sidebar.left',$ev_left);
$ev_right = new ExtEvent($this,FALSE,'blog');
Yii::app()->modulehook->raiseEvent('blog.views.layouts.main.show.sidebar.right',$ev_right);

if(FALSE !== $ev_left->data && NULL !== $ev_left->data) {
	echo '<div class="grid_6 sidebar">';
	ExtHtml::renderExtEvent($ev_left);
	echo '</div>';
	$contentWidth -= 6;
}
if(FALSE !== $ev_right->data) {
	$contentWidth -= 6;
}
echo '<div class="grid_'.$contentWidth.'" id="content">',$content,'</div>';

if(FALSE !== $ev_right->data) {
	echo '<div class="grid_6 sidebar">';
	if(NULL === $ev_right->data) {
		$this->widget('TagsPortlet');
	}
	else {
		ExtHtml::renderExtEvent($ev_right);
	}
	echo '</div>';
}
